﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IntelliLance.Math.Parser
{
    /// <summary>
    /// Defines a methods for processing tokens encountered by the MathParser class.
    /// </summary>
    /// <remarks>
    /// Implement this interface to provide a mechanism for storing and manipulating tokens found by the Parser.
    /// The Framework provides a default implementation for this interface using the Shunting-yard  Algorithm in the SYATokenProcessor class. 
    /// The MathParser class's constructor takes a ITokenProcessor instance as a parameter, you could pass a SYATokenProcessor instance 
    /// or provide your own implementation.
    /// </remarks>
    public interface ITokenProcessor
    {
        /// <summary>
        /// Called each time the parser finds a new token.
        /// </summary>
        void ProcessToken(TokenContext context);
        /// <summary>
        /// Do any final tasks before returning back the token queue.
        /// </summary>
        /// <returns>The tokens queue.</returns>
        Queue<Token> Eval();
    }
}
